Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop horizontal scroll mouse button events on Linux #6644

Merged

Conversation

neilcsmith-net
Copy link
Member

Drop horizontal scroll mouse button events on Linux to fix issues reported with trackpads triggering code navigation. The JDK already drops the X event button number by 2 to skip vertical scroll. This skips the horizontal scroll button values and drops the value another 2 before passing to the keymap, which should also bring Linux in line with other OS button values.

This is an alternative to #6636

Added a build for easier testing. Ideally we should check that Windows and macOS don't need the button 6&7 mappings anywhere.

@neilcsmith-net neilcsmith-net added the ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) label Oct 31, 2023
@neilcsmith-net neilcsmith-net added this to the NB20 milestone Oct 31, 2023
@lkishalmi
Copy link
Contributor

Well, this could work. My only concern is that mouseButtonKeyCode is a public API, we shall notify the users in Javadoc about the additional 4,5 virtual buttons for horizontal scrolling on Linux, so people would be aware of that.

@neilcsmith-net
Copy link
Member Author

Funnily enough, my preference for handling here is partly simplicity, but also because I think it keeps the API as intended.

The mapping of hardware button to OS button to JDK button to NB windows system button is in many ways an implementation detail. In future we could make this change optional or even allow other options in the window system without changing the API.

@mbien mbien added the Editor label Oct 31, 2023
Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree on this approach. Just thought that some additional documentation on the API would be nice.

Copy link
Member

@mbien mbien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense to me

@neilcsmith-net neilcsmith-net force-pushed the mouse-linux-horiz-scroll branch from 98dc2d4 to 0e0560d Compare October 31, 2023 19:19
@neilcsmith-net
Copy link
Member Author

Thanks @lkishalmi Does the added implementation note documentation help? It's a bit weird to work out how best to document this, apart from being clear that doing this aligns with the intended API usage.

Copy link
Contributor

@lkishalmi lkishalmi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now. Thank you!

@neilcsmith-net neilcsmith-net merged commit efe5e17 into apache:delivery Nov 1, 2023
@neilcsmith-net neilcsmith-net deleted the mouse-linux-horiz-scroll branch January 16, 2024 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci:dev-build [ci] produce a dev-build zip artifact (7 days expiration, see link on workflow summary page) Editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants